'use strict';

/**
 * @ngdoc function
 * @name jgappApp.controller:WorkCustsvcCtrl
 * @description
 * # WorkCustsvcCtrl
 * Controller of the jgappApp
 */
angular.module('jgappApp')
    .controller('WorkCustsvcCtrl', function($sce, $scope, UserInfo, $window) {
        var baseurl = "http://www.sobot.com/chat/pc/index.html";
        $scope.trustSrc = function(src) {
                return $sce.trustAsResourceUrl(src);
            }
            // window.location.href = url;
        $scope.goback = function() {
            $window.history.back();
        }
        UserInfo.getUseinfo().then(function(data) {
            console.log(data)
            var param = {
                partnerId: data.result.userId,
                uname: data.result.name,
                dptN: data.result.sysDepartments&&data.result.sysDepartments.departmentName,
                actN: data.result.sysAccounts.accountName,
                tel: data.result.phone
            }
            $scope.someUrl = baseurl + "?sysNum=23e7605b37634d2787e938329741c5f0&partnerId=" + param.partnerId + "&uname=[" + param.actN + "]-" + param.dptN + "-" + param.uname + "&tel=" + param.tel
            console.log($scope.someUrl)
        })
    });
